﻿@page
@{ Layout = "_Layout"; }

<el-card>
    <div slot="header" class="clearfix">
        <span>请选择课程</span>
        <el-button style="float: right;padding:3px 0;" type="text" v-on:click="utils.closeLayerSelf"><i class="el-icon-close"></i></el-button>
    </div>
    <el-form :inline="true" :size="euiSize">
        <el-form-item label="">
            <el-input v-model="formInline.keyword" placeholder="名称，标签 关键字" prefix-icon="el-icon-search" clearable></el-input>
        </el-form-item>
        <el-form-item label="">
            <el-select v-model="formInline.type" placeholder="" v-on:change="btnSearchClick" clearable>
                <el-option label="全部课程类型" value=""></el-option>
                <el-option label="线上课" value="online"></el-option>
                <el-option label="线下课" value="offline"></el-option>
                <el-option label="公共课" value="public"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item>
            <el-button icon="el-icon-search" type="primary" v-on:click="btnSearchClick">查 询</el-button>
            <el-button plain icon="el-icon-plus" type="success" v-on:click="btnAddClick(true)">新增线上课</el-button>
            <el-button plain icon="el-icon-plus" type="warning" v-on:click="btnAddClick(false)">新增线下课</el-button>
        </el-form-item>
    </el-form>
    <el-table ref="table" :data="list" :size="euiSize"
              style="width: 100%" :height="$(window).height()-263">
        <el-table-column type="selection" align="left"
                         width="28">
        </el-table-column>
        <el-table-column label="#"
                         type="index"
                         width="60"
                         align="left">
            <template scope="scope">
                <span>{{(formInline.pageIndex - 1) * formInline.pageSize + scope.$index + 1}}</span>
            </template>
        </el-table-column>
        <el-table-column label="课程名称" show-overflow-tooltip prop="name">
        </el-table-column>
        <el-table-column label="课时" width="85" prop="studyHour">
        </el-table-column>
        <el-table-column label="学分" prop="credit" width="85">
        </el-table-column>
        <el-table-column label="类型" width="85">
            <template slot-scope="scope">
                <span v-if="scope.row.public"><el-tag size="mini" type="primary" effect="dark">公共课</el-tag></span>
                <span v-else>
                    <span v-if="scope.row.offLine"><el-tag size="mini" type="warning" effect="dark">线下课</el-tag></span>
                    <span v-else><el-tag size="mini" type="success" effect="dark">线上课</el-tag></span>
                </span>
            </template>
        </el-table-column>
        <el-table-column prop="createdDate" label="创建时间"
                         width="150">
        </el-table-column>
        <el-table-column width="100">
            <template slot-scope="scope">
                <el-dropdown :show-timeout="0" placement="left">
                    <el-button icon="el-icon-arrow-left" size="mini" v-on:click.stop="return false">
                        操作
                    </el-button>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item icon="el-icon-edit" v-on:click.native="btnEditClick(scope.row)">修改</el-dropdown-item>
                        <el-dropdown-item icon="el-icon-document-copy" v-on:click.native="btnCopyClick(scope.row)">复制</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>
            </template>
        </el-table-column>
        @await Html.PartialAsync("_PartialTableEmpty")
    </el-table>
    <div style="text-align: center; margin-top: 10px;">
        <el-pagination v-on:current-change="handleCurrentChange" background
                       :current-page="formInline.pageIndex"
                       :page-size="formInline.pageSize"
                       layout="total, prev, pager, next, jumper"
                       :total="total">
        </el-pagination>
    </div>
</el-card>
<el-row align="center" style="margin-top:18px;">
    <el-col :span="24" align="center">
        <el-button :size="euiSize" type="primary" v-on:click="btnSelectClick">确 定</el-button>
        <el-button icon="el-icon-close" :size="euiSize" v-on:click="utils.closeLayerSelf">关 闭</el-button>
    </el-col>
</el-row>
@section Scripts{
    <script src="/sitefiles/assets/js/admin/study/studyCourseSelect.js" type="text/javascript"></script>
}